/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javian.characters;

/**
 *
 * @author Michael Redford
 */
public class Player extends Entity
{
    int Level;
    int EXP;
    int MagicPower;
    int MMagicPower;
    String Class;

    int BattlesFought;

    int  Spells[];
    int Attacks[];
    public int GET_Battles_Fought(){ return BattlesFought; }
    public int GET_Level() {return Level;}

    public void Push_Attack(int atk)
    {
        for(int i = 0; i < Attacks.length; i++)
        {
            if(Attacks[i] == -1)
            {
                Attacks[i] = atk;
                break;
            }
        }
    }

    public void Pop_Attack(int atk)
    {
        for(int i = 0; i < Attacks.length; i++)
        {
            if(Attacks[i] == atk)
            {
                Attacks[i] = -1;
                break;
            }
        }
    }

    void Update_Attacks()
    {
        for(int i = 0; i < Attacks.length; i++)
        {
            if(i != -1)
            {
                if(Attacks[i-1] == -1 && Attacks[i] != -1)
                {
                    Attacks[i-1] = Attacks[i];
                    Attacks[i] = -1;
                }
            }
        }
    }

    public Player(String name, String Rank, int hp, int m, int str, int level)
    {
        Name = name;
        Class = Rank;
        MHealth = hp;
        Health = hp;
        MagicPower = m;
        MMagicPower = m;
        Strength = str;
        Level = level;

        Attacks = new int[10];
        Spells = new int[10];

        for(int i = 0; i < Attacks.length; i++)
        {
            Attacks[i] = -1; Spells[i] = -1;
        }
    }
}
